<template>
  <div>
    <el-row>
      <el-col :sm="8">
        <div class="g-title">个人信息</div>
      </el-col>
      <el-col :sm="16" style="text-align:right;">
        <router-link :to="{name:'editUserInfo'}">
          <el-button type="primary" size="mini">修改</el-button>
        </router-link>
      </el-col>
    </el-row>
    <el-row>
      <el-col :sm="8">
        <div class="item">
          <span class="label">姓名</span>
          <span class="value">{{userInfo.username}}</span>
        </div>
      </el-col>
      <el-col :sm="12">
        <div class="item">
          <span class="label">角色</span>
          <span class="value">{{userInfo.roleNames}}</span>
        </div>
      </el-col>
    </el-row>
    <el-row>
      <el-col :sm="8">
        <div class="item">
          <span class="label">性别</span>
          <span class="value">{{userInfo.sex==0?'男':'女'}}</span>
        </div>
      </el-col>
      <el-col :sm="8">
        <div class="item">
          <span class="label">部门</span>
          <span class="value">{{userInfo.deptName}}</span>
        </div>
      </el-col>
    </el-row>
    <el-row>
      <el-col :sm="8">
        <div class="item">
          <span class="label">手机号</span>
          <span class="value">{{userInfo.mobile}}</span>
        </div>
      </el-col>
      <el-col :sm="8">
        <div class="item">
          <span class="label">注册时间</span>
          <span class="value">{{userInfo.registtime}}</span>
        </div>
      </el-col>
    </el-row>
  </div>
</template>
<script>
import { mapGetters } from "vuex";
export default {
  computed: {
    ...mapGetters(["userInfo"])
  },
  data() {
    return {
      isEditing: false
    };
  },
  methods: {
    edit() {}
  }
};
</script>
<style lang="scss" scoped>
.g-title {
  height: 20px;
  padding-left: 8px;
  line-height: 22px;
  font-size: 16px;
  font-weight: 400;
  border-left: 2px solid #f54e40;
  margin: 10px 0;
  display: inline-block;
}
.item {
  font-size: 14px;
  line-height: 40px;
  .label {
    width: 80px;
    color: #606266;
    display: inline-block;
    text-align: right;
    padding: 0 12px 0 0;
    font-weight: bold;
  }
  .value {
    color: #666;
  }
}
</style>